<!-- 模板 -->
<template>
  <div class="home">
    <!-- 3、使用组件 -->
    <div class="home-num">{{ num }}</div>
    <button @click="num++">num++</button>
    <div class="home-box">
      <!-- 子组件绑定属性，绑定自定义事件myEvt -->
      <Btn :txt="num" @myEvt="setNums"></Btn>
    </div>
    <div class="home-foot">
      <Foot></Foot>
    </div>
  </div>
</template>

<script>
//1、引入组件
import Btn from './Btn.vue'
import Foot from './Foot.vue'
export default {
  name: '',
  data() {
    return {
      num: 0
    }
  },
  props: [],
  components: {
    Btn,
    Foot
  },
  computed: {},
  filters: {},
  methods: {
    setNums(v) {
      this.num = v
    }
  },
  created() {},
  mounted() {}
}
</script>

<style lang="less" scoped></style>
